@echo off

set pause=true
if /i "%1"=="/q" (
 set pause=false
 SHIFT
)


RMDIR "..\..\WebOptimizer\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\WebOptimizer\obj" /Q /S
@if errorlevel 1 goto :error

RMDIR "..\..\WebOptimizer.IO.Compression\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\WebOptimizer.IO.Compression\obj" /Q /S
@if errorlevel 1 goto :error

RMDIR "..\..\WebOptimizer.TestClient\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\WebOptimizer.TestClient\obj" /Q /S
@if errorlevel 1 goto :error

RMDIR "..\..\WebOptimizer.UI\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\WebOptimizer.UI\obj" /Q /S
@if errorlevel 1 goto :error

RMDIR "..\..\WebOptimizer.UI.Wpf\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\WebOptimizer.UI.Wpf\obj" /Q /S
@if errorlevel 1 goto :error


@goto :exit



:error
if %returnErrorCode%==false goto exit

@ECHO An error occured - %errorLevel%
PAUSE
@exit errorLevel



:exit
if %pause%==true PAUSE
